<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>农资与农产品全程供应链物流平台-权限设置</title>
<meta name="kewywords" content="农资与农产品全程供应链物流平台"/>
<meta name="description" content="农资与农产品全程供应链物流平台"/>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<script language="javascript" type="text/javascript" src="js/js.js"></script>
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/LocalList.js"></script>	
<script type="text/javascript" src="js/dialog/lhgdialog.js?skin=default"></script>
<script type="text/javascript">
	function addRoleInfo(id){
		if(id==3){
			$("#repertoryLabel").css("display","");
			$("#repertoryValue").css("display","");
			$("#bundlingRepertory").css("display","");
			$("#vehicleno").css("display","none");
			$("#stationId").css("display","none");
		}
		else if(id==5 || id==6){
			$("#vehicleno").css("display","");
			$("#repertoryLabel").css("display","none");
			$("#repertoryValue").css("display","none");
			$("#bundlingRepertory").css("display","none");
			$("#stationId").css("display","none");
		}else if(id==7){
			$("#stationId").css("display","");
			$("#repertoryLabel").css("display","none");
			$("#repertoryValue").css("display","none");
			$("#bundlingRepertory").css("display","none");
			$("#vehicleno").css("display","none");
		}else{
			$("#repertoryLabel").css("display","none");
			$("#repertoryValue").css("display","none");
			$("#bundlingRepertory").css("display","none");
			$("#vehicleno").css("display","none");
			$("#stationId").css("display","none");
		}
	}
	function dialog(id){
		$.dialog({
			height:250,
			width:519,
			lock:true,
			max: false,
			min: false,
			content : 'url:system/bundlingRepertory',
			title : "绑定仓库信息",
			cancelVal : '关闭',
			cancel : true,
			ok:function(){
				$("#repertoryLabel").css("display","");
				$("#repertoryValue").css("display","");
			}
		});
	}
	function jsSelectItemByValue(objSelect, objItemText) {            
	    //判断是否存在        
	    var isExit = false;        
	    for (var i = 0; i < objSelect.options.length; i++) {        
	        if (objSelect.options[i].text == objItemText) {        
	            objSelect.options[i].selected = true;        
	            isExit = true;        
	            break;        
	        }        
	    }   
	}
    function change(radio_oj,aValue){    //传入一个对象
		for(var i=0;i<radio_oj.length;i++){ //循环
			if(radio_oj[i].value==aValue){ //比较值
				radio_oj[i].checked=true; //修改选中状态
				break; //停止循环
			}
    	}
    }
    function saveCheck(){
    	$("#userAuthority").submit();
    }
</script>
</head>
<body>
<%@include file="top.jsp" %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="187" height="37" bgcolor="#e0e0e0" class="brt bbt">
    	<div class="topleft fl">系统菜单栏</div>
    </td>
    <td bgcolor="#e7e7e7" class=" bbt">
    	<div class="topleft fl">您现在的位置：<a href="#">首页</a>&nbsp;>&nbsp;<span>权限设置</span></div>
    </td>
  </tr>
  <tr>
    <td width="187" height="100%" valign="top" bgcolor="#FFFFFF" class="brt">
    	<div class="left_bk"> 
           <div class="menu2">
         <%@include file="system_left.jsp" %>
         </div>
        </div></td>
    <td align="left" valign="top" bgcolor="#FFFFFF">
    <div class="content" style="height:450px">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	        <tr>
				<td height="38" style="background:url(images/zz_tit.jpg) left top repeat-x;">
				<div class="tt_back fl">权限设置</div>
				<div class="fr"><img src="images/tit_right.jpg" alt="" width="103" height="38" /></div>
				</td>
	        </tr>
	        <tr>
	 			<td class="borders btn" align="center">
					<form id="userAuthority" action="system/userAuthority" method="post">
			            <input name="userId" type="hidden" value="<s:property value="admininfo.id"/>" />
						<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
						<tr>
					    <td bgcolor="#fffeee" height="41" style="border-bottom:#fee7bd solid 1px;" align="center">
						    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
						    	<tr class="captitle" bgcolor="#e3e3e3">
									<td height="31" colspan="10"  valign="middle" style="padding-left: 20px;font-weight: bold;">
							                      用户信息
									</td>
								</tr>
								<tr>
									<td align="center" valign="middle">
								        <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">										
											<tr height="26" bgcolor="#efefef">
												<td width="15%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													账号</td>
												<td width="15%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													姓名</td>
												<td width="15%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													账户类型
												</td>
												<td width="15%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													所属区域</td>
												<td width="40%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													地址</td>
											</tr>
											<tr height="26" bgcolor="#efefef">
												<td width="6%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													<s:property value="admininfo.username"/></td>
												<td width="5%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													<s:property value="admininfo.fullName"/></td>
												<td width="8%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
												<s:if test="admininfo.accountType ==1">
													系统管理员
												</s:if>
												<s:if test="admininfo.accountType ==2">
												 	普通用户
												</s:if>
												</td>
												<td width="10%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													<s:property value="admininfo.area"/></td>
												<td width="28%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">
													<s:property value="admininfo.addre"/></td>
											</tr>										
								        </table>
							        </td>
								</tr>
								<tr class="captitle" bgcolor="#e3e3e3">
									<td height="31" colspan="10" valign="middle" style="padding-left: 20px;font-weight: bold;">
										设置权限
									</td>
								</tr>
								<tr>
									<td>
										<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">
											<tr style="height: 40px;" bgcolor="#efefef">
											    <td width="25%" align="right" bgcolor="#FFFFFF">添加用户角色：</td>
											    <td width="25%" bgcolor="#FFFFFF">
												    <select id="roles" onchange="addRoleInfo(this.value);" name="roles" style="width:100px" class="input_are">
													    <option value="1">管理员</option>
														<option value="3">仓管员</option>
														<option value="5">司机</option>
														<option value="6">配送员</option>
														<option value="7">站点管理员</option>
												    </select>
											    </td>
											    <td id="roleInfo" width="50%" colspan="2" align="center" style="padding-right: 300px;" bgcolor="#FFFFFF">											    	
												    <a href='javascript:dialog(2);' id="bundlingRepertory" style="display: none;">绑定用户仓库信息</a>												    
												    <select id="vehicleno" style="display:none;width:100px" name="vehicleno"  class="input_are">
														<s:iterator value="vehicleinfos" id="obj">
															<option value="<s:property value='#obj.vehicleno'/>"><s:property value="#obj.licenseplateno" /></option>     
														</s:iterator>
												    </select>
												    <select id="stationId" style="display:none;width:100px" name="stationId"  class="input_are">
														<s:iterator value="stationsInfos" id="obj">
															<option value="<s:property value='#obj.id'/>"><s:property value="#obj.stationName" /></option>     
														</s:iterator>
												    </select>
											    </td>
											</tr>
											<tr style="height: 30px;display: none" id="repertoryLabel" bgcolor="#efefef">
											    <td width="25%" align="center" valign="middle">仓库编号</td>
											    <td width="25%" align="center" valign="middle">仓库名称</td>
											    <td width="25%" align="center" valign="middle">仓库地址</td>
											    <td width="25%" align="center" valign="middle">仓库类型</td>
											</tr>
											<tr style="height: 30px;display: none" id="repertoryValue" bgcolor="#efefef">
											    <td width="25%" align="center" valign="middle" bgcolor="#FFFFFF">
											    	<input style="width: 120px;" id="repertoryNo" name="repertoryNo" />
											    	</td>
											    <td width="25%" align="center" valign="middle" bgcolor="#FFFFFF">
											    	<input style="width: 120px;" id="repertoryName" name="repertoryName"/>
											    </td>
											    <td width="25%" align="center" valign="middle" bgcolor="#FFFFFF">
											    	<input style="width: 120px;" id="repertoryAddre" name="repertoryAddre"/>
											    </td>
											    <td width="25%" align="center" valign="middle" bgcolor="#FFFFFF">
											    	<input style="width: 120px;" id="repertoryType" name="repertoryType" />
											    </td>
											</tr>
										</table>
									</td>
								</tr>
						    </table>						    
						</td>
						</tr>
						
						<tr>
						    <td align="center">
							    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
									 <!-- 
									<tr>
								        <td colspan="2">
									        <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">
												<tr class="captit">
										            <td width="10%" height="31" align="center" valign="middle">权限名称</td>
										            <td width="11%" height="31" align="center" valign="middle">权限标识</td>
										            <td width="10%" height="31" align="center" valign="middle">权限地址</td>
										            <td width="10%" height="31" align="center" valign="middle">权限设置</td>
												</tr>
												<s:iterator value="authorityList" id="obj" >
												<tr height="26" bgcolor="#efefef">
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#obj.authorityName"/>
										            </td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#obj.authorityCode"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#obj.authorityAddre"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<input type="checkbox" value="<s:property value='#obj.authorityCode'/>" name="authoritys"/>
										            </td>
												</tr>
												</s:iterator>
											</table>
										</td>
									</tr> -->
									<tr>
										<td width="70%" align="center">
									        <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
										  		<tr style="height: 60px;">
												<td colspan="4" align="center">
												<input type="button" style="cursor: pointer;" class="buttons2" value="保存" onclick="saveCheck()"/>
										  			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
												<input type="reset" style="cursor: pointer;" class="buttons2" value="重 置" /></td>
										  		</tr>
									        </table>
								        </td>
									</tr>
								</table>
						    </td>
						</tr>
						</table>
					</form>
				</td>
	        </tr>
		</table>
    </div>
    </td>
  </tr>
</table>
<div class="bottom">版权所有：安徽朗坤物联网</div>
</body>
</html>